﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MapSite.Master" Inherits="System.Web.Mvc.ViewPage<IList<DNB.Models.MapTopModels>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Map Top Two
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">
   <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
   <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=drawing"></script>
   
   <div id="header"><img src="../../Images/imgtech.jpg" width="100%" height="150px" /></div>
    <%:Scripts.Render("~/Scripts/Core/MapTopTwo.js") %>

   <div id="navbar">Home | About</div>
   <div id="maincontain">
       <script>
           var fset = [];
           var index = 0;
           var iconImage = "<%:Url.Content("~/Content/Map/Images/YellowPin1LargeB.png") %>";
           <% foreach (var item in Model)
              { %>
           fset[index] = new google.maps.Marker({
               id: index + 1,
               position: new google.maps.LatLng(<%: item.Lat %>, <%: item.Lon %>),
               icon: iconImage,
           });
           fset[index++].properties = {
               Name: "<%: item.Name %>",
               Lat: <%: item.Lat %>,
               Lon: <%: item.Lon %>
           };
           <% } %>
           //Print content in div tag
           function printDiv(divID) {
               //Get the HTML of div
               var divElements = document.getElementById(divID).innerHTML;
               //Get the HTML of whole page
               var oldPage = document.body.innerHTML;
               //Reset the page's HTML with div's HTML only
               document.body.innerHTML =
                   "<html><head><title></title></head><body>" +
                       divElements + "</body>";
               //Print Page
               window.print('', '', 'left=100,top=10,bottom=10,width=600,height=600,toolbar=0,scrollbars=0,status=0');
               //Restore orignal HTML
               document.body.innerHTML = oldPage;
               window.location = window.location.pathname;
           }
       </script>
      <input value="Print" type="button" onclick="printDiv('map-canvas')" />
      <%--<input id="clearGraphic" value="Clear graphic" type="button"/>--%>
      <input id="getData" value="Get data" type="button"/>
       <div id="map-canvas"></div>
   </div>
   <div id="footer">Copyright 2014</div>
</asp:Content>

